import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Index1Page from '@/views/index1Page.vue'
import Index2Page from "@/views/index2Page.vue";
import marqueePage from "@/views/marqueePage.vue";
import todoList from "@/views/todoList.vue";
import calculateTheListener from "@/views/calculateTheListener.vue";
import getTheElement from "@/views/getTheElement.vue";
import toRefsPage from "@/views/toRefsPage.vue";
import combinedApi from "@/views/combinedApi.vue";
import pageA from "@/views/pageA.vue";
import pageB from "@/views/pageB.vue";
import FatherPage from '@/views/fatherPage.vue';
import keepAlive from "@/views/keepAlive.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/index1',
      component: Index1Page
    },
    {
      path: '/index2',
      component: Index2Page
    },
    {
      path: '/ma',
      component: marqueePage
    },
    {
      path: '/todo',
      component: todoList
    },
    {
      path: '/calculate',
      component: calculateTheListener
    },
    {
      path: '/getEle',
      component: getTheElement
    },
    {
      path: '/toRefs',
      component: toRefsPage
    },
    {
      path: '/comApi',
      component: combinedApi
    },
    {
      path: '/pageA',
      component: pageA
    },
    {
      path: '/pageB/:id',
      // path: '/pageB',
      name:'pageB',
      component: pageB
    },
    {
      path:'/father',
      component:FatherPage
    },
    {
      path:'/keep',
      component:keepAlive
    }
  ],
})

export default router
